package com.sdhs.system.syncdata.common;

import lombok.Getter;

/**
 * @author zhangmy
 * @date 2022/9/2014:10
 * @Description:属性值字段是否必填
 */
public enum DeptRequiredEnum {
    ID("deptId", true),

    ANCESTORS("ancestors", true),
    PID("parentId", true),

//    PCODE("pCode", false),
//    PIDS("pids", true),
    NAME("deptName", true),
    ORDERNUM("orderNum", true),
//    TYPE("type", false),
//    SORT("sort", true),
//    SPELL("spell", false),
//    HASLEAF("hasLeaf", true),
//    PROPERTY("property", false),
    STATUS("status",false),
//    DELFLAG("delFlag",false),
    FULLNAME("fullName", true);
//    ZHUYUNID("zhuyunId",true),
//    ZHUYUNPID("zhuyunPid",true);




    @Getter
    final String fieldName;
    @Getter
    final boolean required;

    DeptRequiredEnum(String fieldName, boolean required) {
        this.fieldName = fieldName;
        this.required = required;
    }

    public static String getValue(String name) {
        DeptRequiredEnum[] reEnum = values();
        for (DeptRequiredEnum type : reEnum) {
            if (name.equals(type.fieldName)) {
                return String.valueOf(type.required);
            }
        }
        return null;
    }
}
